package models

import (
	"time"
	"tuowei.com/common/models"
)

type SysMaterial struct {
	models.Model
	Name         string  `json:"name" gorm:"size:20;comment:资料名称"`
	Type         string  `json:"type" gorm:"size:10;comment:资料类型"`
	Category     string  `json:"category" gorm:"size:10;comment:资料分类"`
	Subject      string  `json:"subject" gorm:"size:10;comment:资料科目"`
	Cover        string  `json:"cover" gorm:"size:50;comment:封面"`
	Status       int     `json:"status" gorm:"size:1;comment:资料状态"`
	Sum          int     `json:"sum" gorm:"size:10;comment:资料数量"`
	Price        float32 `json:"price" gorm:"size:10;comment:资料价格"`
	Introduction string  `json:"introduction" gorm:"size:255;comment:资料简介"`
	Postage      float32 `json:"postage" gorm:"size:20;comment:资料邮费"`
	Province     string  `json:"province" gorm:"type:varchar(20);comment:适用地区"`
	CourseType   string  `json:"course_type" gorm:"-"`
	LBTUrl       string  `json:"lbt_url" gorm:"type:varchar(5000);comment:轮播图地址"`
	models.ControlBy
	models.ModelTime
}

func (s SysMaterial) TableName() string {
	return "sys_material"
}

type SysMaterialUpdateStatus struct {
	models.Model
	Status    int       `json:"status" gorm:"size:1;comment:资料状态"`
	Updater   string    `json:"updater" gorm:"comment:更新者姓名"`
	UpdateBy  int       `json:"updateBy" gorm:"index;comment:更新者"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
}

func (s SysMaterialUpdateStatus) TableName() string {
	return "sys_material"
}
